setMovementConstraint

Set a rule that limits how far blocks can be positioned outside their parent page during user interactions (drag, resize, touch gestures, crop). Programmatic API calls are not affected.

MovementConstraintRule.overshoot is a non-negative fraction of the moved block's own size: 0f pins blocks fully inside the page, 0.3f allows 30% to extend past the page bounds. The rule's MovementConstraintRule.scope determines which blocks it applies to.

Use removeMovementConstraint to clear a rule.

When multiple rules match a block, the most specific one wins: block parent page blockType scene-wide.

Parameters

rule

the rule to apply.


Set multiple movement constraint rules at once. See setMovementConstraint for details on a single rule.

Parameters

rules

the rules to apply.